﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportInventoryAgingM.aspx.cs"
    Inherits="sWarranty.WEB.ReportInventoryAgingM" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="../UC/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../CSS/table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/Menu.css" />
    <link href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" rel="stylesheet"
        type="text/css" />
    <script src="../JS/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="../JS/jquery-ui.js" type="text/javascript"></script>
    <script src="../JS/Menu.js" type="text/javascript"></script>
    <script src="../JS/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
    <link href="../JS/chosen-master/chosen/chosen.css" rel="stylesheet" type="text/css" />
    <script src="../JS/chosen-master/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script src="../JS/jquery.stickytableheaders.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //LoadFirstInven();
            $("table").stickyTableHeaders();
            SetLogger();
        });

        //        function LoadMore(currentPage) {
        //            $('#imgLoadingxyz').show();
        //            var options = {
        //                type: 'POST',
        //                url: 'WebService1.asmx/viewNext100ReportInvenMonthlyPage ',
        //                data: '{currentPage: "' + currentPage + '"}',
        //                contentType: 'application/json; charset=utf-8',
        //                dataType: 'json',
        //                success: function (data) {
        //                    if (data != '') {
        //                        var lines2 = (data.d).split('||');
        //                        var nextPage = '';
        //                        var msg = '';
        //                        $.each(lines2, function (key, line) {
        //                            nextPage = lines2[0];
        //                            msg = lines2[1];
        //                        });
        //                        var _curPobject = document.getElementById("curPage");
        //                        _curPobject.value = nextPage;
        //                        $("#newspaper-b").append(msg);
        //                        $('#imgLoadingxyz').hide();
        //                    }
        //                },
        //                error: function (e) {
        //                    $('#imgLoadingxyz').hide();
        //                }
        //            };
        //            //$.ajax(options).always(function () { is_loading = false; });
        //        }
        //        var is_loading = false;

        //        function LoadFirstInven() {
        //            $('#imgLoadingxyz').show();
        //            var options = {
        //                type: 'POST',
        //                url: 'WebService1.asmx/LoadFirstInven ',
        //                data: '',
        //                contentType: 'application/json; charset=utf-8',
        //                dataType: 'json',
        //                success: function (data) {
        //                    if (data != '') {
        //                        $("#newspaper-b").html(data.d);
        //                        $('#newspaper-b tbody tr td').each(function () {
        //                            var colSpan = 1;
        //                            while ($(this).text() == $(this).next().text()) {
        //                                $(this).next().remove();
        //                                colSpan++;
        //                            }
        //                            $(this).attr('colSpan', colSpan);
        //                        });
        //                        $('#imgLoadingxyz').hide();
        //                    }
        //                },
        //                error: function (e) {
        //                }
        //            };
        //            //$.ajax(options);
        //        }
        //        jQuery(
        //              function ($) {
        //                  $(window).bind('scroll', function () {
        //                      //if ($(window).scrollTop() >= $(document).innerHeight() >= $(window)[0].scrollHeight - 0.9999 * ($(window)[0].scrollHeight)) {
        //                      if ($(window).scrollTop() >= ($(document).innerHeight() - 0.99999 * ($(document).innerHeight()))) {
        //                          if (is_loading) {
        //                              return;
        //                          }
        //                          is_loading = true;
        //                          var _curP = $("#curPage").val();
        //                          var _curPobject = document.getElementById("curPage");
        //                          LoadMore(parseInt(_curP));
        //                      }
        //                  })
        //              }
        //            );
              
    </script>
    <style type="text/css">
        .style1
        {
            width: 176px;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnExcel').qtip({
                content: 'You should un-group Grid data first to view raw data.',
                show: 'mouseover',
                hide: 'mouseout',
                position: {
                    corner: {
                        target: 'topMiddle',
                        tooltip: 'bottomLeft'
                    }
                },
                style: {
                    name: 'dark' // Inherit from preset style
                }

            })
        });

       
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ksdjfl" runat="server">
    </asp:ScriptManager>
    <uc1:Header ID="Header1" runat="server" />
    <div class="Mid">
        <div class="Mid1">
            <div id="DataContent">
                <%-- <div>
                    Nội dung bên trái
                </div>--%>
                <div>
                    <div class="TitleTab">
                        <ul>
                            <li><a href="ReportInventoryAgingD.aspx">Daily</a></li>
                            <li><a href="ReportInventoryAgingW.aspx">Weekly</a></li>
                            <li><a href="ReportInventoryAgingM.aspx" class="TitleTab_act">Monthly</a> </li>
                        </ul>
                    </div>
                    <!-- DataGrid Start -->
                    <div class="Search">
                        <table>
                            <tr>
                                <td style="background-color: #F7F7F7">
                                    Year :
                                </td>
                                <td>
                                    <asp:DropDownList ID="dropYear" runat="server" Width="100%" CssClass="chzn-select"
                                        data-placeholder="..Year..">
                                        <asp:ListItem Value="1990" Text="1990"></asp:ListItem>
                                        <asp:ListItem Value="1991" Text="1991"></asp:ListItem>
                                        <asp:ListItem Value="1992" Text="1992"></asp:ListItem>
                                        <asp:ListItem Value="1993" Text="1993"></asp:ListItem>
                                        <asp:ListItem Value="1994" Text="1994"></asp:ListItem>
                                        <asp:ListItem Value="1995" Text="1995"></asp:ListItem>
                                        <asp:ListItem Value="1996" Text="1996"></asp:ListItem>
                                        <asp:ListItem Value="1997" Text="1997"></asp:ListItem>
                                        <asp:ListItem Value="1998" Text="1998"></asp:ListItem>
                                        <asp:ListItem Value="1999" Text="1999"></asp:ListItem>
                                        <asp:ListItem Value="2000" Text="2000"></asp:ListItem>
                                        <asp:ListItem Value="2001" Text="2001"></asp:ListItem>
                                        <asp:ListItem Value="2002" Text="2002"></asp:ListItem>
                                        <asp:ListItem Value="2003" Text="2003"></asp:ListItem>
                                        <asp:ListItem Value="2004" Text="2004"></asp:ListItem>
                                        <asp:ListItem Value="2005" Text="2005"></asp:ListItem>
                                        <asp:ListItem Value="2006" Text="2006"></asp:ListItem>
                                        <asp:ListItem Value="2007" Text="2007"></asp:ListItem>
                                        <asp:ListItem Value="2008" Text="2008"></asp:ListItem>
                                        <asp:ListItem Value="2009" Text="2009"></asp:ListItem>
                                        <asp:ListItem Value="2010" Text="2010"></asp:ListItem>
                                        <asp:ListItem Value="2011" Text="2011"></asp:ListItem>
                                        <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                                        <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                                        <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                                        <asp:ListItem Value="2015" Text="2015"></asp:ListItem>
                                        <asp:ListItem Value="2016" Text="2016"></asp:ListItem>
                                        <asp:ListItem Value="2017" Text="2017"></asp:ListItem>
                                        <asp:ListItem Value="2018" Text="2018"></asp:ListItem>
                                        <asp:ListItem Value="2019" Text="2019"></asp:ListItem>
                                        <asp:ListItem Value="2020" Text="2020"></asp:ListItem>
                                        <asp:ListItem Value="2021" Text="2021"></asp:ListItem>
                                        <asp:ListItem Value="2022" Text="2022"></asp:ListItem>
                                        <asp:ListItem Value="2023" Text="2023"></asp:ListItem>
                                        <asp:ListItem Value="2024" Text="2024"></asp:ListItem>
                                        <asp:ListItem Value="2025" Text="2025"></asp:ListItem>
                                        <asp:ListItem Value="2026" Text="2026"></asp:ListItem>
                                        <asp:ListItem Value="2027" Text="2027"></asp:ListItem>
                                        <asp:ListItem Value="2028" Text="2028"></asp:ListItem>
                                        <asp:ListItem Value="2029" Text="2029"></asp:ListItem>
                                        <asp:ListItem Value="2030" Text="2030"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td style='width: 10px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    Product
                                </td>
                                <td class="style1">
                                    <asp:DropDownList ID="dropAu" runat="server" Width="100%" CssClass="chzn-select"
                                        data-placeholder="..All..">
                                    </asp:DropDownList>
                                </td>
                                <td style='width: 10px'>
                                </td>
                                <%--<td style="background-color: #F7F7F7">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td style='width: 10px'>
                                    </td>--%>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td style="background-color: #F7F7F7">
                                    BillTo Code:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtBillCode" runat="server" Width="100%"></asp:TextBox>
                                </td>
                                <td style='width: 10px'>
                                </td>
                                <td style="background-color: #F7F7F7">
                                    Model:
                                </td>
                                <td class="style1">
                                    <asp:TextBox ID="txtModel" runat="server" Width="100%"></asp:TextBox>
                                </td>
                                <td style='width: 10px'>
                                </td>
                                <%--<td style="background-color: #F7F7F7">
                                    </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    &nbsp;</td>--%>
                                <td>
                                    <asp:Button ID="btnExcel" ClientIDMode="Static" runat="server" OnClick="btnExcel_Click"
                                        Width="80px" CssClass="button Float-right" Text="Export" />
                                    <asp:Button ID="btnFind" runat="server" CssClass="button Float-right" Width="80px"
                                        Text="Search" OnClick="btnFind_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divScroll" style="overflow: auto;">
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
                            AutoGenerateColumns="False" OnColumnCreated="RadGrid1_ColumnCreated" CssClass="RadGridCustomClass"
                            GridLines="None" ShowGroupPanel="True" OnNeedDataSource="RadGrid1_NeedDataSource"
                            BorderWidth="1px" OnGroupsChanging="RadGrid1_GroupsChanging" Skin="Office2007"
                            OnItemDataBound="RadGrid1_ItemDataBound">
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
                            </ClientSettings>
                            <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true">

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>

                                <PagerStyle AlwaysVisible="True" />
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn Aggregate="Custom" DataField="BILL_TO" HeaderText="BILL_TO"
                                        FooterText="Total">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BILL_NAME" HeaderText="BILL_NAME" SortExpression="BILL_NAME"
                                        UniqueName="BILL_NAME">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PRODUCT" HeaderText="PRODUCT" SortExpression="PRODUCT"
                                        UniqueName="PRODUCT">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="MODEL" HeaderText="MODEL" SortExpression="MODEL"
                                        UniqueName="MODEL">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="STOCK" HeaderText="STOCK" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="INVENTORY" HeaderText="INVENTORY" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="ACM" HeaderText="ACM" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="JAN" HeaderText="JAN" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="FEB" HeaderText="FEB" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="MAR" HeaderText="MAR" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="APR" HeaderText="APR" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="MAY" HeaderText="MAY" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="JUN" HeaderText="JUN" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="JUL" HeaderText="JUL" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="AUG" HeaderText="AUG" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="SEP" HeaderText="SEP" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="OCT" HeaderText="OCT" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="NOV" HeaderText="NOV" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataField="DEC" HeaderText="DEC" FooterText=" ">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="BILL_TO"></telerik:GridGroupByField>
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="BILL_TO" HeaderText="BILL_TO"></telerik:GridGroupByField>
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>

<FilterMenu EnableImageSprites="False"></FilterMenu>
                        </telerik:RadGrid>
                    </div>
                    <!-- DataGrid End -->
                </div>
            </div>
            <div class="Clear_both">
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(".chzn-select").chosen();
    </script>
    </form>
</body>
</html>
